<include file="Public/min-header" />
<div class="wrapper">
    <include file="Public/breadcrumb"/>
	<section class="content">
       <div class="row">
       		<div class="col-xs-12">
	       		<div class="box">
	             <div class="box-header">
	               	<nav class="navbar navbar-default">	     
				        <div class="collapse navbar-collapse">
				          <form class="navbar-form form-inline" action="{:U('System/right_list')}" method="post">
				            <div class="form-group">
				              	<input type="text" name="keywords" class="form-control" placeholder="搜索">
				            </div>
				            <button type="submit" class="btn btn-default">提交</button>
				            <div class="form-group pull-right">
				            	<a href="{:U('System/edit_right')}" class="btn btn-default"><i class="fa fa-plus"></i>添加</a>
				            	<a href="javascript:;" data-url="{:U('System/right_del')}" onclick="delAll(this,'right')" class="btn btn-default"><i class="fa fa-minus"></i>删除</a>
				            </div>		          
				          </form>		
				      	</div>
	    			</nav>  
	             </div>	             
	             <div class="box-body">	               
	           		<div class="row">
	            	<div class="col-sm-12">
		              <table id="list-table" class="table table-bordered table-striped dataTable">
		                 <thead>
		                   <tr role="row">
			                   <th class="text-center"><input type="checkbox" onclick="choosebox(this)">全选</th>
			                   <th class="text-center">名称</th>
			                   <th class="text-center">所属分组</th>
			                   <th class="text-center">权限码</th>
			                   <th class="text-center">操作</th>
		                   </tr>
		                 </thead>
						<tbody>
						  <foreach name="right_list" item="vo" key="k" >
						  	<tr role="row" align="center">
		                     <td><input type="checkbox" name="right[]" value="{$vo.id}"></td>
		                     <td>{$vo.name}</td>
		                     <td>{$group[$vo[group]]}</td>
		                     <td><div style="width:500px;word-wrap:break-word;">{$vo.right}</div></td>
		                     <td>
		                      <a class="btn btn-primary" href="{:U('System/edit_right',array('id'=>$vo['id']))}"><i class="fa fa-pencil"></i></a>
		                      <a class="btn btn-danger" href="javascript:void(0)" data-url="{:U('System/right_del')}" data-id="{$vo.id}" onclick="delfunc(this)"><i class="fa fa-trash-o"></i></a>
							</td>
		                   </tr>
		                  </foreach>
		                   </tbody>
		                 <tfoot>		                 
		                 </tfoot>
		               </table>	 
	               </div>
	          </div>
              <div class="row">
              	    <div class="col-sm-6 text-left"></div>
                    <div class="col-sm-6 text-right">{$page}</div>		
              </div>
	         </div>
	        </div>
       	</div>
       </div>
   </section>
</div>
<script>
function choosebox(o){
	var vt = $(o).is(':checked');
	if(vt){
		$('input[type=checkbox]').prop('checked',vt);
	}else{
		$('input[type=checkbox]').removeAttr('checked');
	}
}
</script> 
</body>
</html>